And only enable `--fatal-warnings` if `-Dwerror` has been set, just like
we do for the introspection data generation.
command: [
gidocgen,
'generate',
- '--quiet',
- '--fatal-warnings',
+ gidocgen_common_args,
'--add-include-path=@0@'.format(meson.current_build_dir() / '../../../gtk'),
'--config=@INPUT0@',
'--output-dir=@OUTPUT@',
- '--no-namespace-dir',
'--content-dir=@0@'.format(meson.current_source_dir()),
'@INPUT1@',
],
command: [
gidocgen,
'generate',
- '--quiet',
- '--fatal-warnings',
+ gidocgen_common_args,
'--add-include-path=@0@'.format(meson.current_build_dir() / '../../../gtk'),
'--config=@INPUT0@',
'--output-dir=@OUTPUT@',
- '--no-namespace-dir',
'--content-dir=@0@'.format(meson.current_source_dir()),
'@INPUT1@',
],
command: [
gidocgen,
'generate',
- '--quiet',
- '--fatal-warnings',
+ gidocgen_common_args,
'--add-include-path=@0@'.format(meson.current_build_dir() / '../../../gtk'),
'--config=@INPUT0@',
'--output-dir=@OUTPUT@',
- '--no-namespace-dir',
'--content-dir=@0@'.format(meson.current_source_dir()),
'@INPUT1@',
],
command: [
gidocgen,
'generate',
- '--quiet',
- '--fatal-warnings',
+ gidocgen_common_args,
'--add-include-path=@0@'.format(meson.current_build_dir() / '../../../gtk'),
'--config=@INPUT0@',
'--output-dir=@OUTPUT@',
- '--no-namespace-dir',
'--content-dir=@0@'.format(meson.current_source_dir()),
'@INPUT1@',
],
command: [
gidocgen,
'generate',
- '--quiet',
- '--fatal-warnings',
+ gidocgen_common_args,
'--add-include-path=@0@'.format(meson.current_build_dir() / '../../../gtk'),
'--config=@INPUT0@',
'--output-dir=@OUTPUT@',
- '--no-namespace-dir',
'--content-dir=@0@'.format(meson.current_source_dir()),
'@INPUT1@',
],
gidocgen = find_program('gi-docgen', required: get_option('gtk_doc'))
+gidocgen_common_args = [
+ '--quiet',
+ '--no-namespace-dir',
+]
+
+if get_option('werror')
+ gidocgen_common_args += ['--fatal-warnings']
+endif
+
docs_dir = gtk_datadir / 'doc'
if get_option('gtk_doc') and not build_gir